<template>
  <div>
    <gray-line></gray-line>
    <list-title :item="item"></list-title>
    <ul>
      <li class="item border-bottom" v-for="(item,id) of likesList" :key="id">
        <img class="item-img" :src="item.imgUrl">
        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <div class="item-stars-wrapper">
            <rating-stars :space="0.03" :score="item.stars"></rating-stars>
            <span class="item-comments">{{item.comments}}条评论</span>
          </div>
          <div class="item-price-address">
            <price-tag :price='item.price' :pricestyle=" { fontSize:'.4rem' } "></price-tag>
            <span class="item-address">{{item.address}}</span>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>
<script>
import GrayLine from './grayLine'
import ListTitle from './listTitle'
import RatingStars from '@/components/ratingStars'
import PriceTag from './price'
export default {
  name: 'HomeRecommend',
  props: ['likesList'],
  components: {
    GrayLine,
    ListTitle,
    RatingStars,
    PriceTag
  },
  data () {
    return {
      item: {
        text: '猜你喜欢',
        class: 'iconfont icon-cainixihuan'
      }
    }
  }
}
</script>
<style lang="stylus" scoped>
  .item
    overflow hidden
    display flex
    height 1.9rem
    padding .1rem
    .item-img
      width 1.7rem
      height 1.7rem
      padding .1rem
    .item-info
      flex 1
      padding-left .1rem
      .item-title
        margin-top: .26rem;
        height: .44rem;
        color: #212121;
        font-size: .32rem;
        line-height: .44rem;
      .item-stars-wrapper
        margin-top: .14rem;
        height: .34rem;
        display: flex;
        flex-direction: row;
        align-items: center;
        .item-comments
          color: #616161;
          font-size: .24rem;
          height: 0.27rem;
          line-height: .34rem;
          margin-left .2rem
          vertical-align: text-bottom;
      .item-price-address
        position: relative;
        margin-top: .22rem;
        color: #616161;
        font-size: .24rem;
        line-height: .4rem;
        .item-address
          position absolute
          right .24rem
</style>
